#!/usr/bin/env python
# coding: utf-8

# In[1]:


import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import math
from scipy.stats import skew


# In[2]:


df = pd.read_csv("D:/research/recordbreak/climatology/precp_all.csv", index_col=0)
print(df)


# In[3]:


#df.set_index('date', inplace=True)
#df.index = pd.to_datetime(df.index)


# # Indus

# In[29]:


# Plot the indus climatology 1981-2010
fig, ax = plt.subplots(figsize=(20, 10))

# Plot ind_obs
plt.plot(df.index, df['ind_obs'], marker='o', markersize=12, linestyle='-', color='black', label='Observed', linewidth=5)

# Plot ind45_p50
plt.plot(df.index, df['ind45_p50'], marker='o', markersize=12, linestyle='-', color='green', label='CORDEX-SA', linewidth=4)

# Plot CI 5-95%
plt.fill_between(df.index, df['ind45_p5'], df['ind45_p95'], alpha=0.2, color='green') 


# Plot ind45_p5
#plt.plot(df.index, df['ind45_p5'], marker='s', linestyle='--', color='r', label='ind45_p5')
# Plot ind45_p95
#plt.plot(df.index, df['ind45_p95'], marker='x', linestyle=':', color='purple', label='ind45_p95')
#plt.title('streamflow climatology')

#plt.xlabel('Month', fontsize=30)
#plt.ylabel('Streamflow ($m^3/sec$)', fontsize=30)

plt.xticks(fontsize=30)  # ,fontweight='bold'
plt.yticks(fontsize=30)
#plt.ticklabel_format(axis='y', style='sci', scilimits=(0,0))
plt.gca().tick_params(axis='x', which='major', length=16, width=4)  # Set the desired length and width
plt.gca().tick_params(axis='y', which='major', length=16, width=4)

# Increase the thickness of the border around the plot
for spine in plt.gca().spines.values():
    spine.set_linewidth(4)

# Adding a legend
#plt.legend(loc='upper right', prop={'size': 26})
legend = plt.legend(loc='upper right', prop={'size': 30}, bbox_to_anchor=(0.99, 0.98), borderaxespad=0.)
legend.get_frame().set_linewidth(4)
legend.get_frame().set_edgecolor('black') 
#plt.ylim(-3, 15)
plt.xlim(-0.1, 11.1)
ax.yaxis.grid(True, linestyle='--', linewidth=1)
plt.show()


# # Kabul

# In[30]:


# Plot the Kabul climatology 1981-2010
fig, ax = plt.subplots(figsize=(20, 10))

# Plot ind_obs
plt.plot(df.index, df['kab_obs'], marker='o', markersize=12, linestyle='-', color='black', label='Observed', linewidth=5)

# Plot ind45_p50
plt.plot(df.index, df['kab45_p50'], marker='o', markersize=12, linestyle='-', color='green', label='CORDEX-SA', linewidth=4)

# Plot CI 5-95%
plt.fill_between(df.index, df['kab45_p5'], df['kab45_p95'], alpha=0.2, color='green') 


# Plot ind45_p5
#plt.plot(df.index, df['kabd45_p5'], marker='s', linestyle='--', color='r', label='ind45_p5')
# Plot ind45_p95
#plt.plot(df.index, df['kab45_p95'], marker='x', linestyle=':', color='purple', label='ind45_p95')
#plt.title('streamflow climatology')

#plt.xlabel('Month', fontsize=30)
#plt.ylabel('Streamflow ($m^3/sec$)', fontsize=30)

plt.xticks(fontsize=30)  # ,fontweight='bold'
plt.yticks(fontsize=30)
#plt.ticklabel_format(axis='y', style='sci', scilimits=(0,0))
plt.gca().tick_params(axis='x', which='major', length=16, width=4)  # Set the desired length and width
plt.gca().tick_params(axis='y', which='major', length=16, width=4)

# Increase the thickness of the border around the plot
for spine in plt.gca().spines.values():
    spine.set_linewidth(4)

# Adding a legend
#plt.legend(loc='upper right', prop={'size': 26})
legend = plt.legend(loc='upper right', prop={'size': 30}, bbox_to_anchor=(0.99, 0.98), borderaxespad=0.,ncol=2)
legend.get_frame().set_linewidth(4)
legend.get_frame().set_edgecolor('black') 
plt.ylim(-4, 24)
plt.xlim(-0.1, 11.1)
ax.yaxis.grid(True, linestyle='--', linewidth=1)
plt.show()


# # Jehlum

# In[31]:


# Plot the Jehlum climatology 1981-2010
fig, ax = plt.subplots(figsize=(20, 10))

# Plot ind_obs
plt.plot(df.index, df['jeh_obs'], marker='o', markersize=12, linestyle='-', color='black', label='Observed', linewidth=5)

# Plot ind45_p50
plt.plot(df.index, df['jeh45_p50'], marker='o', markersize=12, linestyle='-', color='green', label='CORDEX-SA', linewidth=4)

# Plot CI 5-95%
plt.fill_between(df.index, df['jeh45_p5'], df['jeh45_p95'], alpha=0.2, color='green') 


# Plot ind45_p5
#plt.plot(df.index, df['kabd45_p5'], marker='s', linestyle='--', color='r', label='ind45_p5')
# Plot ind45_p95
#plt.plot(df.index, df['kab45_p95'], marker='x', linestyle=':', color='purple', label='ind45_p95')
#plt.title('streamflow climatology')

#plt.xlabel('Month', fontsize=30)
#plt.ylabel('Streamflow ($m^3/sec$)', fontsize=30)

plt.xticks(fontsize=30)  # ,fontweight='bold'
plt.yticks(fontsize=30)
#plt.ticklabel_format(axis='y', style='sci', scilimits=(0,0))
plt.gca().tick_params(axis='x', which='major', length=16, width=4)  # Set the desired length and width
plt.gca().tick_params(axis='y', which='major', length=16, width=4)

# Increase the thickness of the border around the plot
for spine in plt.gca().spines.values():
    spine.set_linewidth(4)

# Adding a legend
#plt.legend(loc='upper right', prop={'size': 26})
#legend = plt.legend(loc='upper right', prop={'size': 30}, bbox_to_anchor=(0.99, 0.98), borderaxespad=0.)
#legend.get_frame().set_linewidth(4)
#legend.get_frame().set_edgecolor('black') 
plt.ylim(-4, 24)
plt.xlim(-0.1, 11.1)
ax.yaxis.grid(True, linestyle='--', linewidth=1)
plt.show()


# # Chenab

# In[32]:


# Plot the Chenab climatology 1981-2010
fig, ax = plt.subplots(figsize=(20, 10))

# Plot ind_obs
plt.plot(df.index, df['che_obs'], marker='o', markersize=12, linestyle='-', color='black', label='Observed', linewidth=5)

# Plot ind45_p50
plt.plot(df.index, df['che45_p50'], marker='o', markersize=12, linestyle='-', color='green', label='CORDEX-SA', linewidth=4)

# Plot CI 5-95%
plt.fill_between(df.index, df['che45_p5'], df['che45_p95'], alpha=0.2, color='green') 


# Plot ind45_p5
#plt.plot(df.index, df['kabd45_p5'], marker='s', linestyle='--', color='r', label='ind45_p5')
# Plot ind45_p95
#plt.plot(df.index, df['kab45_p95'], marker='x', linestyle=':', color='purple', label='ind45_p95')
#plt.title('streamflow climatology')

#plt.xlabel('Month', fontsize=30)
#plt.ylabel('Streamflow ($m^3/sec$)', fontsize=30)

plt.xticks(fontsize=30)  # ,fontweight='bold'
plt.yticks(fontsize=30)
#plt.ticklabel_format(axis='y', style='sci', scilimits=(0,0))
plt.gca().tick_params(axis='x', which='major', length=16, width=4)  # Set the desired length and width
plt.gca().tick_params(axis='y', which='major', length=16, width=4)

# Increase the thickness of the border around the plot
for spine in plt.gca().spines.values():
    spine.set_linewidth(4)

# Adding a legend
#plt.legend(loc='upper right', prop={'size': 26})
#legend = plt.legend(loc='upper right', prop={'size': 30}, bbox_to_anchor=(0.99, 0.98), borderaxespad=0.)
#legend.get_frame().set_linewidth(4)
#legend.get_frame().set_edgecolor('black') 
plt.ylim(-4, 24)
plt.xlim(-0.1, 11.1)
ax.yaxis.grid(True, linestyle='--', linewidth=1)
plt.show()


# In[ ]:





# In[ ]:





# In[ ]:





# In[ ]:





# In[ ]:





# In[ ]:




